<input type="hidden" value="${obj.equipment_id}" id="equipment_id">
<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
  <ul class="layui-tab-title" id="equipment_info_tab">
    <li class="layui-this" data_type="sbjbzl">设备基本资料</li>
    <li data_type="csxx">设备厂商</li>
    <li data_type="jsjk">技术接口</li>
    <li data_type="sbzp">设备照片</li>
    <li data_type="yhxqs">用户需求书</li>
    <li data_type="tjtjt">土建条件图</li>
    <li data_type="bimodel">BIM模型</li>
  </ul>
  <div class="layui-tab-content">
    <div class="layui-tab-item layui-show">
    </div>
  </div>
</div>
<script type="text/javascript">
var equipment_id = $.trim($("#equipment_id").val());

var go_gy_equipment = function(){
	$.ajax({
			url : base + "/dataCenter/gyEquipment?name=工艺设备数据库",
			data : {},
			type : "POST",
			async: false,
			success : function(data) {
				$(".right-article").remove();
				$("#content").html("");
				$("#content").html(data);
	        	return false;
			},
			fail : function(res) {
				layer.msg('系统错误！', {
					icon : 5
				});
			}
	});
	}

//下载资料
var downFile = function(that){
	var $v = $(that);
	var type = $v.attr("data_id");
	var show_file_url = base+"/datacenter/common/downFileById/"+type+"/"+equipment_id;
	window.open(show_file_url,"_self")
	return false;
}
	
	
$(function(){
	$("#equipment_info_tab").children("li").click(function(){
		$("#equipment_info_tab").children("li").removeClass("layui-this");
		$(this).addClass("layui-this");
		var data_type = $.trim($(this).attr("data_type"));
		$(".layui-show").html("");
		if(data_type == "sbjbzl"){
			var url = base + "/dataCenter/equipment/findEquipmentBasic/"+equipment_id;
			$.get(url,function(result){
				var data = result.data;
				var html = '<div class="btn-team"><button class="btn btn-default" onclick="go_gy_equipment();">返回上页</button>'+
			               '<div class="row row-right-content"><textarea style="width:100%;height:300px;text-indent: 2em;">'+data+'</textarea></div>';
			    $(".layui-show").html(html);
			})
		}else if(data_type == "csxx"){
			var url = base + "/dataCenter/equipment/findEquipmentCsxx/"+equipment_id;
			$.get(url,function(result){
				var data = result.data;
				var html = '<div class="btn-team"><button class="btn btn-default" onclick="go_gy_equipment();">返回上页</button></div>'+
			               '<div class="row row-right-content"><textarea style="width:100%;height:300px;text-indent: 2em;">'+data+'</textarea></div>';
			    $(".layui-show").html(html);
			})
		}else if(data_type == "sbzp"){
			var url = base + "/dataCenter/equipment/findEquipmentPhoto/"+equipment_id;
			$.get(url,function(result){
				var data = result.data;
				var html = '<div class="col-sm-12" style="margin-top: 20px;"><div class="btn-team"><button class="btn btn-default" onclick="go_gy_equipment();">返回上页</button>'+
				'<span>&nbsp</span><button class="btn btn-default" onclick="downFile(this);" data_id="sbzp">下载</button></div>'+
				'<div class="row row-right-content"><iframe src="'+data+'" scrolling="no" style="width:100%;height:650px" ></iframe></div></div>';
				$(".layui-show").html(html);
			})
		}else if(data_type == "tjtjt"){
			//土建条件图改成
			var url = base + "/dataCenter/equipment/findEquipmentTjtjt/"+equipment_id;
			$.get(url,function(result){
				var data = result;
				var html = '<div class="col-sm-12" style="margin-top: 20px;"><div class="btn-team"><button class="btn btn-default" onclick="go_gy_equipment();">返回上页</button></div>'+
				'<div class="row row-right-content">'+result+'</div></div>';
				$(".layui-show").html(html);
			})
		}else if(data_type == "yhxqs"){
			var url = base + "/dataCenter/equipment/findEquipmentYhxqs/"+equipment_id;
			$.get(url,function(result){
				var data = result.data;
				var html = '<div class="col-sm-12" style="margin-top: 20px;"><div class="btn-team"><button class="btn btn-default" onclick="go_gy_equipment();">返回上页</button>'+
				'<span>&nbsp</span><button class="btn btn-default" onclick="downFile(this);" data_id="yhxqs">下载</button></div>'+
				'<div class="row row-right-content"><iframe src="'+data+'" scrolling="no" style="width:100%;height:650px" ></iframe></div></div>';
				$(".layui-show").html(html);
			})
		}else if(data_type == "jsjk"){
			var url = base + "/dataCenter/equipment/findEquipmentJsjk/"+equipment_id;
			$.get(url,function(result){
				var data = result.data;
				var html = '<div class="col-sm-12" style="margin-top: 20px;"><div class="btn-team"><button class="btn btn-default" onclick="go_gy_equipment();">返回上页</button>'+
				'<span>&nbsp</span><button class="btn btn-default" onclick="downFile(this);" data_id="jsjk">下载</button></div>'+
				'<div class="row row-right-content"><iframe src="'+data+'" scrolling="no" style="width:100%;height:650px" ></iframe></div></div>';
				$(".layui-show").html(html);
			})
		}else if(data_type == "bimodel"){
			var url = base + "/dataCenter/equipment/findEquipmentBimodel/"+equipment_id;
			$.get(url,function(result){
				var data = result.data;
				var html = '<div class="col-sm-12" style="margin-top: 20px;"><div class="btn-team"><button class="btn btn-default" onclick="go_gy_equipment();">返回上页</button>'+
				'<span>&nbsp</span><button class="btn btn-default" onclick="downFile(this);" data_id="bimodel">下载</button></div>'+
				'<div class="row row-right-content"><iframe src="'+data+'" scrolling="no" style="width:100%;height:650px" ></iframe></div></div>';
				$(".layui-show").html(html);
			})
		}
	});
	
	$(".layui-this").trigger("click");
	
});
</script> 

